﻿namespace Hippo.Common
{
    using System;
    using System.Text.RegularExpressions;

    /// <summary>
    /// Command line option
    /// </summary>
    public class Option
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Option"/> class.
        /// </summary>
        /// <param name="label">Documentation label</param>
        /// <param name="description">Text that describes what this command line argument means.</param>
        /// <param name="expression">Regular expression that will match the command line argument.</param>
        /// <param name="action">The action that should be executed with the value of this command line argument.</param>
        public Option(string label, string description, string expression, Action<string> action)
        {
            Label = label;
            Description = description;
            Expression = expression;
            Action = action;
        }

        /// <summary>
        /// Gets or sets the documentation label.
        /// </summary>
        /// <value>The label.</value>
        public string Label { get; private set; }

        /// <summary>
        /// Gets or sets the text that describes what this command line argument means.
        /// </summary>
        public string Description { get; private set; }

        /// <summary>
        /// Gets or sets the regular expression that will match the command line argument
        /// </summary>
        public string Expression { get; private set; }
        
        /// <summary>
        /// Gets or sets the action that should be executed with the value of this command line argument
        /// </summary>
        public Action<string> Action { get; private set; }
    }
}
